import react from "react";
import React,{Component} from 'react'

export default class Control extends Component{
    state = {inp1:'', inp2:'', inp3:'', inp4:'', inp5:''}
    inpChange = (type) => {
        return (e)=>{
            this.setState( {[type]: e.target.value} );
        }
    }
    render(){
        const {inp1, inp2, inp3, inp4, inp5} = this.state;
        return(
            <div>
                <input 
                    value={inp1}
                    onChange={this.inpChange('inp1')}
                />
                <input 
                    value={inp2}
                    onChange={this.inpChange('inp2')}
                />
                <input 
                    value={inp3}
                    onChange={this.inpChange('inp3')}
                />
                <input 
                    value={inp4}
                    onChange={this.inpChange('inp4')}
                />
                <input 
                    value={inp5}
                    onChange={this.inpChange('inp5')}
                />
            </div>
        )
    }
}